$(function(){
	selectTabs();
})

function addTabs(){
	var myTabs=$("#myTabs");
	myTabs.tabs("add",{
		title:"新面板",
		index:1,
		select:true,
		content:"This is a new Tab",
		closable:true
	})
	selectTabs();
}
function removeTabs(){
	var myTabs=$("#myTabs");
	var tab = myTabs.tabs("getSelected");
	var index = myTabs.tabs("getTabIndex",tab);
	myTabs.tabs("close",index);
	
}

function selectTabs(){
	var myTabs=$("#myTabs");
	var panelArr = myTabs.tabs("tabs");
	for(var i=0;i<panelArr.length;i++){
		var panelUI = panelArr[i];
		var title = panelUI.panel("options").tab;
		title.off().on("mouseenter",i,function(e){
			myTabs.tabs("select",e.data);
		})
	}
}




